package com.shambles.manage2.tkmapper.mapper;

import com.shambles.manage2.tkmapper.entity.AbattoirBoothDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.insert.InsertListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface AbattoirBoothDetailMapper extends Mapper<AbattoirBoothDetail>, InsertListMapper<AbattoirBoothDetail> {
    /**
     * 查询摊位明细
     */
    @Select("select * from abattoir_booth_detail where booth_guid='${boothGuid}'")
    List<AbattoirBoothDetail> queryBoothDetail(@Param("boothGuid")  String boothGuid);

    /**
     * 统计摊位明细
     */
    @Select("select count(*) from abattoir_booth_detail where booth_guid='${boothGuid}'")
    int countByBoothGuid(@Param("boothGuid") String boothGuid);

    @Delete("delete from abattoir_booth_detail  where admission_guid='${admissionGuid}'")
    void deleteByAdmissionGuid(String admissionGuid);

    @Select("select * from abattoir_booth_detail where admission_guid='${admissionGuid}'")
    List<AbattoirBoothDetail> selectByAdmissionGuid(@Param("admissionGuid") String admissionGuid);
}